#ifndef ONELINERTOOLBOX_H
#define ONELINERTOOLBOX_H

/**
Nectarine Utility Project is a software interface for the web system 'demovibes'
Copyright (C) 2010  Alexandre LAURENT

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

website: http://code.google.com/p/nectarine-utility-project/
e-mail: lw.demoscene@gmail.com
**/

#include <QToolBar>

#include <QColor>

class QToolButton;
class QAction;
class QMenu;
class QSignalMapper;

class OnelinerToolBox : public QToolBar
{
    Q_OBJECT

private:

    QToolButton* pBoldButton;
    QToolButton* pItalicButton;
    QToolButton* pUnderlinedButton;
    QToolButton* pStrikeButton;

    QToolButton* pColourButton;

    QToolButton* pSongButton;
    QToolButton* pArtistButton;
    QToolButton* pUserButton;
    QToolButton* pGroupButton;
    QToolButton* pCompilationButton;
    QToolButton* pForumButton;
    QToolButton* pThreadButton;
    QToolButton* pFlagButton;

    QAction* pBoldAction;
    QAction* pItalicAction;
    QAction* pUnderlinedAction;
    QAction* pStrikeAction;

    QAction* pColourAction;

    QAction* pSongAction;
    QAction* pArtistAction;
    QAction* pUserAction;
    QAction* pGroupAction;
    QAction* pCompilationAction;
    QAction* pForumAction;
    QAction* pThreadAction;
    QAction* pFlagAction;

    QMenu* pColourMenu;

    QSignalMapper* pSignalMapper;

    void initColourMenu(void);

protected slots:

    // BBCode addition (when asking something)
    void needSendUserColourSignal(void);
    void needSendSongSignal(void);
    void needSendArtistSignal(void);
    void needSendUserSignal(void);
    void needSendGroupSignal(void);
    void needSendCompilationSignal(void);
    void needSendForumSignal(void);
    void needSendThreadSignal(void);
    void needSendFlagSignal(void);

signals:

    // BBCode addition (when asking something)
    void needUserColour(QColor colour);
    void needSong(unsigned int id);
    void needArtist(unsigned int id);
    void needUser(QString name);
    void needGroup(unsigned int id);
    void needCompilation(unsigned int id);
    void needForum(unsigned int id);
    void needThread(unsigned int id);
    void needFlag(QString flag);

public:
    OnelinerToolBox(QWidget* parent=0);
    ~OnelinerToolBox();

    QAction* getBoldAction(void)const { return pBoldAction; }
    QAction* getItalicAction(void)const { return pItalicAction; }
    QAction* getUnderlineAction(void)const { return pUnderlinedAction; }
    QAction* getStrikeAction(void)const { return pStrikeAction; }

    QSignalMapper* getSignalMapper(void)const { return pSignalMapper; }
};

#endif // ONELINERTOOLBOX_H
